-- NPC Broadcast Message by MrSheen --

-- Set how many minutes delay you want the NPC to broadcast. --
local delayminutes = 40

-- Set the messages that you want to be broadcasted. --
local broadcastmessage = {'Do you want to donate to the server and get awesome donation items in reward? Buy your points in this link, You can donating by using SMS, Phone or Paypal: http://Nixoria.hopto.org/index.php?subtopic=buypoints' }

-- Main Code --
local messagecounter = 1
local timer = os.time ( )

function onThink()

    if ( ( os.time ( ) - timer ) > delayminutes * 60 ) then
   
		broadcastMessage ( broadcastmessage[messagecounter], 19 )
		
		if messagecounter == #broadcastmessage then
		
			messagecounter = 1
			
		else
		
			messagecounter = messagecounter + 1
			
		end

        timer = os.time ( )
    
    end

end